import http from "./request";

// 选择数据
export function getFirstClassify() {
  return http({
    url: "home/getFirstClassify",
    method: "GET",
  });
}
// 详情数据
export function getMajorApi(id) {
  return http({
    url: `home/getMajor/${id}`,
    method: "GET",
  });
}
// tab数据
export function getTabApi(id) {
  return http({
    url: `home/getSecondClassify/1?classify_id=${id}`,
    method: "GET",
  });
}
// 点击切换数据
export function getTabClassifyCourse(params) {
  let { classify_id } = params
  return http({
    url: `home/classifyCourse/${classify_id}`,
    method: "GET",
    params
  });
}

// 轮播数据
export function getBannerApi(id) {
  return http({
    url: `home/banner/${id}/4`,
    method: "GET",
  });
}

// 近期公开课
export function getMarketingCourseApi(id) {
  return http({
    url: `home/marketingCourse/1?classify_id=${id}`,
    method: "GET",
  });
}
// 详情数据
export function getCourseInfoApi(id) {
  return http({
    url: `courseInfo/basis_id=${id}/st=0`,
    method: "GET",
  });
}

// 课程评价数据
export function getAllCommentByTypeApi(data) {
  return http({
    url: `getAllCommentByType`,
    method: "POST",
    data
  });
}
// 课程按排
export function getOrderByChapterList(id) {
  return http({
    url: `courseInfo/orderByChapterList/${id}`,
    method: "GET",
  });
}
// 推荐好课
export function getRecommendCourse(id) {
  return http({
    url: `home/recommendCourse/${id}`,
    method: "GET",
  });
}
// 推荐好课
export function getSearchClassifyCourse(params) {
  let { classify_id } = params
  return http({
    url: `home/classifyCourse/1?${classify_id}`,
    method: "GET",
    params
  });
}
// 图像验证码
export const getImgCodeAPi = () => http({
  url: `getImgCode`,
  method: "GET",
})
// 手机号验证码
export const geSmscodeAPi = (data) => http({
  url: `getsmscode`,
  method: "POST",
  data
})
// 点击登录注册页登录
export const geLoginAPi = (data) => http({
  url: `login`,
  method: "POST",
  data
})
// 点击修改短信通知
export const geMsgNoticeAPi = (status) => http({
  url: `msgNotice?is_msg_notice=${status}`,
  method: "GET",
})
// 设置密码
export const gepasswordAPi = (data) => http({
  url: `getpassword`,
  method: "POST",
  data
})
// 点击收藏
export const geCollectAPi = (data) => http({
  url: `collect`,
  method: "POST",
  data
})
// 收藏列表数据
export const geCollectListAPi = () => http({
  url: `collect`,
  method: "GET",
})
// 个人信息
export const geShowoneAPi = (id) => http({
  url: `showone/id=${id}?id=${id}`,
  method: "GET",
})
// 更新个人信息
export const geUpdateInfoAPi = (params) => http({
  url: `updateInfo`,
  method: "PUT",
  params
})
// 广场数据
export const geThemeListAPi = () => http({
  url: `square/themeList`,
  method: "GET",
})
// 图书勘误
export const geNewsclassifyAPi = (params) => http({
  url: `news/classify`,
  method: "GET",
  params
})
// 话题数据
export const geSquareListAPi = (params) => http({
  url: `square/squareList`,
  method: "GET",
  params
})
// 我的课
export const geStudyCourseListAPi = () => http({
  url: `myCourse/studyCourseList`,
  method: "GET",
})